package cn.zwx.learn.basic.redis_lock;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @description: 续命线程信息类
 * @projectName:java-basic
 * @see:cn.zwx.learn.basic.redis_lock
 * @author:zhangwenxue
 * @createTime:2021/3/24 9:54
 * @version:1.0
 */
public class ContinueLifeTheadData {

    /**
     * @description 获取锁的线程
     **/
    final Thread owningThread;
    /**
     * @description redisKey
     **/
    final String lockKey;
    /**
     * @description redisValue
     **/
    final String lockValue;
    /**
     * @description 守护线程
     **/
    final Thread daemonThread;
    /**
     * @description 续命线程
     **/
    final ContinueLifeThead continueLifeThead;
    /**
     * @description 重入次数
     **/
    final AtomicInteger lockCount;


    ContinueLifeTheadData(Thread owningThread, String lockKey, String lockValue, Thread daemonThread, ContinueLifeThead continueLifeThead) {
        this.owningThread = owningThread;
        this.lockKey = lockKey;
        this.lockValue = lockValue;
        this.daemonThread = daemonThread;
        this.continueLifeThead = continueLifeThead;
        this.lockCount = new AtomicInteger(1);
    }

}
